---t_armskill.csv
---@class ArmskillBean
local ArmskillBean = ClientFight.CreateClass("ArmskillBean")
 function ArmskillBean:ctor()
     --//技能id
     --@TplAttr(name = "f_ArmSkill")
    self.f_ArmSkill = 0
     --@TplAttr(name = "f_ArmSkillReal")
     self.f_ArmSkillReal = 0
     --//解锁专武等级
     --@TplAttr(name = "f_ArmSkill_Lv")
     ---@type number[]
     self.f_ArmSkill_Lv = nil
     --//DMP替换参数值
     --@TplAttr(name = "f_Replace")
     ---@type number[]
     self.f_Replace = nil
 end
function ArmskillBean:loadCfg(cfg)
    self.f_ArmSkill = cfg.f_ArmSkill
    self.f_ArmSkillReal = cfg.f_ArmSkillReal
    self.f_ArmSkill_Lv = decodeJsonStrToTabel(cfg.f_ArmSkill_Lv)
    self.f_Replace = decodeJsonStrToTabel(cfg.f_Replace)
end
function ArmskillBean:isUnlock(weaponLv)

    if self.f_ArmSkill_Lv==nil or self.f_Replace==nil then return false end
    local length = table.getn(self.f_ArmSkill_Lv)
    local length2 = table.getn(self.f_Replace)
    if ( length < 1 or length2 < 1 or length ~= length2) then
       return false;
    end
    for k,lv in pairs(self.f_ArmSkill_Lv) do
        if lv <= weaponLv then
            return true
        end
    end
    return false;
end
function ArmskillBean:getDynamicParam(weaponLv)
    local param = 0
    for k,v in pairs(self.f_ArmSkill_Lv) do
        if(v<=weaponLv) then
            param = self.f_Replace[k]
        end
    end
    return param
end